home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / feel0_89.lha / Feel / Src / global.h < prev    next >
C/C++ Source or Header  |  1993-07-15  |  8KB  |  275 lines

  1. /* ******************************************************************** */
  2. /*  global.h         Copyright (C) Codemist and University of Bath 1989 */
  3. /*                                                                      */
  4. /* Global variables                                            */
  5. /* ******************************************************************** */
  6.  
  7. /*
  8.  * $Id: global.h,v 2.1 1993/01/17 17:25:21 pab Exp pab $
  9.  *
  10.  * $Log: global.h,v $
  11.  * Revision 2.1  1993/01/17  17:25:21  pab
  12.  * 17 Jan 1993 The next generation...
  13.  *
  14.  * Revision 1.14  1992/11/26  15:47:18  pab
  15.  * Env Support, IFunctions, Etc
  16.  *
  17.  * Revision 1.12  1992/08/06  18:11:24  pab
  18.  * i function support
  19.  *
  20.  * Revision 1.11  1992/06/18  19:36:19  pab
  21.  * Tidied up relics
  22.  *
  23.  * Revision 1.10  1992/04/27  21:56:27  pab
  24.  * changed malloc decl
  25.  *
  26.  * Revision 1.9  1992/04/26  21:01:22  pab
  27.  * definition of add_root and allocate_static_vector
  28.  *
  29.  * Revision 1.8  1992/02/27  15:48:17  pab
  30.  * lose alloc_condition
  31.  *
  32.  * Revision 1.7  1992/02/10  12:08:45  pab
  33.  * macroised allocate_integer
  34.  *
  35.  * Revision 1.6  1992/01/29  13:41:50  pab
  36.  * sysV fixes
  37.  *
  38.  * Revision 1.5  1992/01/10  15:17:56  pab
  39.  * changed allocate_integer for fixnums
  40.  *
  41.  * Revision 1.4  1991/12/22  15:14:11  pab
  42.  * Xmas revision
  43.  *
  44.  * Revision 1.3  1991/11/15  13:44:52  pab
  45.  * copyalloc rev 0.01
  46.  *
  47.  * Revision 1.2  1991/09/11  12:07:16  pab
  48.  * 11/9/91 First Alpha release of modified system
  49.  *
  50.  * Revision 1.1  1991/08/12  16:49:39  pab
  51.  * Initial revision
  52.  *
  53.  * Revision 1.7  1991/05/16  11:23:16  pab
  54.  * 'C' garbage collector support
  55.  *
  56.  * Revision 1.5  1991/02/13  18:21:16  kjp
  57.  * New class declarations.
  58.  *
  59.  */
  60.  
  61. /*
  62.  * Change Log:
  63.  *   Version 1, April 1989
  64.  *     Reserved slot declarations and make_special_symbol prototype
  65.  */
  66.  
  67. #ifndef GLOBAL_H
  68. #define GLOBAL_H
  69.  
  70. #include <stdio.h>
  71. #ifndef SETJMP_H
  72. #define SETJMP_H
  73. #include <setjmp.h>
  74. #endif
  75.  
  76. #ifdef WITH_BIGNUMS
  77. extern void initialise_bignums(void);
  78. extern LispObject Big_Integer;
  79. #endif
  80.  
  81. extern LispObject ObList;
  82.  
  83. extern LispObject Object;
  84. extern LispObject nil;
  85. extern LispObject lisptrue;
  86. extern LispObject unbound;
  87.  
  88. /* Meta classes */
  89.  
  90.  
  91. extern LispObject Object;
  92. extern LispObject  Standard_Class;
  93. extern LispObject   Slot_Description_Class;
  94. extern LispObject     Slot_Description;
  95. extern LispObject      Local_Slot_Description;
  96.  
  97. extern LispObject Abstract_Class;
  98.  
  99. /* Allocation specifying metaclasses */
  100.  
  101. extern LispObject Structure_Class;                /* Like to C structs */
  102. extern LispObject Funcallable_Object_Class;       /* Function forms */
  103. extern LispObject Generic_Class;
  104. extern LispObject Pair_Class;
  105. extern LispObject Unpredictable_Fixed_Size_Class; /* Vector-type things */
  106. extern LispObject Variable_Size_Keyed_Class;      /* Tabular instances */
  107. extern LispObject Thread_Class;
  108. extern LispObject Method_Class;
  109.  
  110. /* The core building blocks */
  111.  
  112. extern LispObject Abstract_Class; /* Meta */
  113. extern LispObject Number, Real, Integer;
  114. extern LispObject Symbol, Character, String;
  115. extern LispObject Thread, Continue;
  116. extern LispObject Function, Generic, Method,CFunction,IFunction;
  117.  
  118. /* Composites */
  119.  
  120. extern LispObject Cons, Vector, Table, Null;
  121.  
  122. /* Pointer */
  123.  
  124. extern LispObject Weak_Wrapper;
  125.  
  126. /* KJP prototypes */
  127.  
  128. extern LispObject Slot_Initarg;
  129. extern LispObject Default_Initargs;
  130.  
  131. extern LispObject Object_Class;     /* Reserved slot symbols */
  132. extern LispObject Class_Name;
  133. extern LispObject Class_Parent;
  134. extern LispObject Class_Children;
  135. extern LispObject Class_Instance_Description;
  136.  
  137. extern LispObject Slot_Class; /* A slot option */
  138.  
  139. extern LispObject Slot_Name;                    /* Slot descriptor fields */
  140. extern LispObject Slot_Position;
  141. extern LispObject Slot_Reader;
  142. extern LispObject Slot_Writer;
  143. extern LispObject Slot_Initform;  /* Local */
  144. extern LispObject Slot_Value;     /* Shared */
  145.  
  146. extern void make_special_symbol(LispObject*, LispObject *, char * );
  147.  
  148. extern void put_table( LispObject, LispObject );
  149.  
  150. extern void bootstrap(LispObject*);
  151. extern LispObject Fn_plus(LispObject*);
  152. extern LispObject Fn_difference(LispObject*);
  153.  
  154. /* Vectors */
  155.  
  156. extern void initialise_vectors(LispObject* );
  157.  
  158. /* Others I needed prototypes for */
  159.  
  160. EUDECL(Fn_symbolvalue);
  161.  
  162. /* KJP def end */
  163.  
  164. extern LispObject q_eof;
  165.  
  166. int add_root(LispObject *);
  167. EUDECL( Fn_cons);
  168. extern LispObject allocate_symbol(LispObject*,char *);
  169. extern LispObject get_symbol(LispObject*,char *); /* Use this one */
  170. LispObject allocate_vector(LispObject *,int);
  171. LispObject allocate_static_vector(LispObject *,int);
  172. LispObject allocate_static_string(LispObject *, int);
  173. extern LispObject allocate_function(int,LispObject(*)(), int, LispObject);
  174.  
  175. extern LispObject Fn_nreverse(LispObject*);
  176. extern LispObject make_table(LispObject*);
  177. extern LispObject Fn_table_ref(LispObject*);
  178. extern LispObject Fn_table_ref_setter(LispObject*);
  179. extern LispObject Fn_length(LispObject*);
  180. extern LispObject Fn_nconc(LispObject *);
  181.  
  182. extern LispObject allocate_char(LispObject*,int);
  183. extern LispObject allocate_string(LispObject*,char *,int);
  184.  
  185.  
  186. #ifdef NOLOWTAGINTS
  187. #define STATIC_INTEGERS 1024
  188. extern LispObject static_ints;
  189.  
  190. extern LispObject real_allocate_integer(LispObject*, int);
  191. #define allocate_integer(stacktop,x) \
  192.   ((x>=0 && x<STATIC_INTEGERS) ? vref(static_ints,x) : real_allocate_integer(stacktop,x))
  193.     
  194. #else
  195. #define allocate_integer(waste,x) (mk_fixnum(x))
  196. #endif
  197.  
  198. #define MAX_CHAR 256 /* 0-255 + EOF */
  199.  
  200. extern LispObject allocate_float(LispObject*,double);
  201. extern LispObject allocate_continue(LispObject*);
  202. extern LispObject allocate_thread(LispObject*,int, int, int);
  203. extern LispObject allocate_module(LispObject*,LispObject, LispObject, LispObject);
  204. extern LispObject make_module_function(LispObject*,
  205.                        char *, LispObject(*)(), int);
  206. extern LispObject make_special(char *, LispObject(*)());
  207. extern LispObject allocate_env(LispObject*,LispObject, LispObject, LispObject);
  208. extern LispObject allocate_envimut(LispObject*,
  209.                    LispObject, LispObject, LispObject);
  210.  
  211. extern LispObject allocate_condition_class(LispObject*,int, LispObject, 
  212.                        LispObject, LispObject);
  213. extern LispObject allocate_class(LispObject*,LispObject);
  214. extern LispObject allocate_instance(LispObject*,LispObject);
  215.  
  216. extern void initialise_input(LispObject*);
  217. extern void re_initialise_input(void);
  218. extern LispObject sym_quote;
  219. extern LispObject sym_quasiquote;
  220. extern LispObject sym_unquote;
  221. extern LispObject sym_progn;
  222. extern LispObject sym_defun;
  223. extern LispObject sym_defglobal;
  224. extern LispObject sym_setq;
  225.  
  226. extern void initialise_output(LispObject*);
  227. extern void initialise_eval(void);
  228. extern LispObject sym_lambda;
  229. extern void initialise_basic(LispObject*);
  230. extern void initialise_generics(LispObject*);
  231. extern void initialise_chars(LispObject*);
  232. extern void initialise_streams(LispObject*);
  233. extern void initialise_tables(LispObject*);
  234. extern void initialise_set(LispObject*);
  235. extern void initialise_error(LispObject*);
  236. extern void initialise_arith(LispObject*);
  237. extern void initialise_threads(LispObject*);
  238. extern void initialise_modules(LispObject*);
  239. extern void initialise_classes(LispObject*);
  240. extern void initialise_bit_vectors(LispObject *);
  241. extern LispObject sym_handler, sym_accept, sym_decline;
  242. extern LispObject sym_dynamic;
  243. extern LispObject sym_dynamic_let;
  244.  
  245. #ifdef CGC
  246. #define malloc gc_malloc
  247. #endif
  248.  
  249. #ifdef NEEDS_MALLOC
  250. #ifdef __STDC__
  251. extern void *malloc(int); /* not size_t yet */
  252. #else
  253. extern char* malloc(int);
  254. #endif
  255. #endif
  256.  
  257. #ifndef HAS_BCOPY
  258. #define bcopy(x,y,z) memcpy(y,x,z)
  259. #endif
  260. /*
  261.  * Globally used thread information... 
  262.  */
  263.  
  264. #include "state.h"
  265.  
  266. #define STACK(x) 0
  267. #define UNSTACK(n) 0
  268.  
  269. #define N_SLOTS_IN_STRUCT(x) \
  270.   (((sizeof(x))-sizeof(Object_t))/sizeof(LispObject))
  271.  
  272.  
  273. #endif /* GLOBAL_H */
  274. /* End of global.h */
  275.